package com.example.springboot_16_rabbitmq.message;

import com.example.springboot_16_rabbitmq.pojo.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "hello")
public class ObjectReceiver {
    @RabbitHandler
    public  void process(User user)
    {
        System.out.println("接收到对象:"+user);
    }
}
